![]() |
GetNewPalette |
||||
Header: | Palettes.h | Carbon status: | Supported | |
Creates and initializes a palette from a ‘pltt’ resource.
PaletteHandle GetNewPalette ( SInt16 PaletteID );
The resource ID of the source palette.
A handle to the new palette.
The GetNewPalette function detaches the resource when it creates the new palette, so you do not need to call the ReleaseResource function.
If you open a new color window with GetNewCWindow, the Window Manager calls GetNewPalette automatically, with paletteID equal to the window’s resource ID. Therefore, if you have created a palette resource with the same ID as a window, the Window Manager and Palette Manager automatically create the palette for you and your application need not call GetNewPalette to create the palette.
To attach a palette to a window after creating it, use the SetPalette function. To change the entries in a palette after creating it, use the SetEntryColor and SetEntryUsage functions.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)